import request from "./request"

export interface LoginData  {
    username : string,
    password : string,
    isRememberMe: boolean
}

export interface RegisterData {
    username : string,
    nickname : string,
    phone: string,
    email: string
    password : string,
}

//登录
export const login = (data : LoginData) => {
    return request({
        url: "/uaa/verify/login",
        method: "POST",
        data
    })
}

//注销
export const logout = () => {
    return request(({
        url: "/uaa/verify/logout",
        method: "POST"
    }))
}

//注册
export const register = (data : RegisterData) => {
    return request({
        url: "/uaa/verify/register",
        method: "POST",
        data
    })
}

//获取用户权限
export const getPerms = () => {
    return request({
        url: "/uaa/auth/permissions",
        method: "GET"
    })
}

//获取用户角色
export const getRoles = () => {
    return request({
        url: "/uaa/auth/roles",
        method: "GET"
    })
}

//获取用户信息
export const getUserInfo = () => {
    return request({
        url: "/uaa/auth/user",
        method: "GET"
    })
}

